/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package org.japo.java.matisse.samples;

import java.awt.Font;

/**
 *
 * @author usuario
 */
public class EtiquetaAsistida extends javax.swing.JFrame {

    /**
     * Creates new form EtiquetaAsistida
     */
    public EtiquetaAsistida() {
        initComponents();
    }

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        lblPrueba = new javax.swing.JLabel();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        addMouseMotionListener(new java.awt.event.MouseMotionAdapter() {
            public void mouseMoved(java.awt.event.MouseEvent evt) {
                formMouseMoved(evt);
            }
        });

        lblPrueba.setText("Etiqueta de prueba");
        lblPrueba.addMouseWheelListener(new java.awt.event.MouseWheelListener() {
            public void mouseWheelMoved(java.awt.event.MouseWheelEvent evt) {
                lblPruebaMouseWheelMoved(evt);
            }
        });
        lblPrueba.addMouseMotionListener(new java.awt.event.MouseMotionAdapter() {
            public void mouseDragged(java.awt.event.MouseEvent evt) {
                lblPruebaMouseDragged(evt);
            }
            public void mouseMoved(java.awt.event.MouseEvent evt) {
                lblPruebaMouseMoved(evt);
            }
        });

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addGap(142, 142, 142)
                .addComponent(lblPrueba)
                .addContainerGap(166, Short.MAX_VALUE))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addGap(132, 132, 132)
                .addComponent(lblPrueba)
                .addContainerGap(154, Short.MAX_VALUE))
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void formMouseMoved(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_formMouseMoved
//        int x = evt.getX();
//        int y = evt.getY();
//        lblPrueba.setLocation(x,y);
    }//GEN-LAST:event_formMouseMoved

    private void lblPruebaMouseWheelMoved(java.awt.event.MouseWheelEvent evt) {//GEN-FIRST:event_lblPruebaMouseWheelMoved
//        // Cambiar tamaño de la fuente con la rueda del raton
//        Font f = lblPrueba.getFont();
//        String tipografia = f.getFamily();
//        int estilo = f.getStyle();
//        int talla = f.getSize();
//        
//        if (evt.getWheelRotation() > 0) {
//            talla++;
//        }else{
//            talla--;
//        }
//        f = new Font(tipografia, estilo, talla);
//        lblPrueba.setFont(f);
        
    }//GEN-LAST:event_lblPruebaMouseWheelMoved

    private void lblPruebaMouseMoved(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_lblPruebaMouseMoved
        
    }//GEN-LAST:event_lblPruebaMouseMoved

    private void lblPruebaMouseDragged(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_lblPruebaMouseDragged
       lblPrueba.setLocation(this.getMousePosition());
    }//GEN-LAST:event_lblPruebaMouseDragged

    /**
     * @param args the command line arguments
     */
    public static void main(String args[]) {
        /*
         * Set the Nimbus look and feel
         */
        //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
        /*
         * If Nimbus (introduced in Java SE 6) is not available, stay with the
         * default look and feel. For details see
         * http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html
         */
        try {
            for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
                if ("Nimbus".equals(info.getName())) {
                    javax.swing.UIManager.setLookAndFeel(info.getClassName());
                    break;
                }
            }
        } catch (ClassNotFoundException ex) {
            java.util.logging.Logger.getLogger(EtiquetaAsistida.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (InstantiationException ex) {
            java.util.logging.Logger.getLogger(EtiquetaAsistida.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (IllegalAccessException ex) {
            java.util.logging.Logger.getLogger(EtiquetaAsistida.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (javax.swing.UnsupportedLookAndFeelException ex) {
            java.util.logging.Logger.getLogger(EtiquetaAsistida.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        }
        //</editor-fold>

        /*
         * Create and display the form
         */
        java.awt.EventQueue.invokeLater(new Runnable() {

            public void run() {
                new EtiquetaAsistida().setVisible(true);
            }
        });
    }
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JLabel lblPrueba;
    // End of variables declaration//GEN-END:variables
}
